<?php
	include_once 'isLogin.php';
	include_once 'model/upload.class.php';
	
	$table_name = "service";
	
	if($_POST['submit']){
		//插入数据库
		$data = array('tel'=>$_POST['tel'],'qq'=>$_POST['qq'],'weixin'=>$_POST['weixin']);
			$commonc->insert($table_name,$data);
			$href='service_add.php';
			$id = $commonc->insert_id();
		echo $commonc->submitAlert('成功',$href);
	}
	
	//获得数据
	$sql="select * from service order by id DESC limit 0,1";
	$query=mysql_query($sql);
	$row=mysql_fetch_array($query, MYSQL_ASSOC);
	$smarty->assign('row',$row);
	$smarty->display($_filename.".html");
?>